package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;

import com.ruoyi.system.mapper.api.EExchangeRecordMapper;
import com.ruoyi.system.domain.api.EExchangeRecord;
import com.ruoyi.system.service.IEExchangeRecordService;

/**
 * 兑换记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-22
 */
@DataSource(DataSourceType.SLAVE)
@Service
public class EExchangeRecordServiceImpl implements IEExchangeRecordService 
{
    @Autowired
    private EExchangeRecordMapper eExchangeRecordMapper;

    /**
     * 查询兑换记录
     * 
     * @param id 兑换记录主键
     * @return 兑换记录
     */
    @Override
    public EExchangeRecord selectEExchangeRecordById(Long id)
    {
        return eExchangeRecordMapper.selectEExchangeRecordById(id);
    }

    /**
     * 查询兑换记录列表
     * 
     * @param eExchangeRecord 兑换记录
     * @return 兑换记录
     */
    @Override
    public List<EExchangeRecord> selectEExchangeRecordList(EExchangeRecord eExchangeRecord)
    {
        return eExchangeRecordMapper.selectEExchangeRecordList(eExchangeRecord);
    }

    /**
     * 新增兑换记录
     * 
     * @param eExchangeRecord 兑换记录
     * @return 结果
     */
    @Override
    public int insertEExchangeRecord(EExchangeRecord eExchangeRecord)
    {
        eExchangeRecord.setCreateTime(DateUtils.getNowDate());
        return eExchangeRecordMapper.insertEExchangeRecord(eExchangeRecord);
    }

    /**
     * 修改兑换记录
     * 
     * @param eExchangeRecord 兑换记录
     * @return 结果
     */
    @Override
    public int updateEExchangeRecord(EExchangeRecord eExchangeRecord)
    {
        return eExchangeRecordMapper.updateEExchangeRecord(eExchangeRecord);
    }

    /**
     * 批量删除兑换记录
     * 
     * @param ids 需要删除的兑换记录主键
     * @return 结果
     */
    @Override
    public int deleteEExchangeRecordByIds(Long[] ids)
    {
        return eExchangeRecordMapper.deleteEExchangeRecordByIds(ids);
    }

    /**
     * 删除兑换记录信息
     * 
     * @param id 兑换记录主键
     * @return 结果
     */
    @Override
    public int deleteEExchangeRecordById(Long id)
    {
        return eExchangeRecordMapper.deleteEExchangeRecordById(id);
    }
}
